2f5d2b27d848696121e1d3f7be1f7cdf91e0a70b,rvm/src/org/jikesrvm/compilers/opt/regalloc/ppc/StackManager.java,StackManager,restoreScratchRegistersBefore,#Instruction#,755
Before Change
Register scratchContents = scratch.currentContents;
if (scratchContents != null) {
if (VERBOSE_DEBUG) {
System.out.println("RSRB2: End symbolic interval " + scratch.currentContents + " " + s);
}
scratchMap.endSymbolicInterval(scratch.currentContents, s);
}
}
After Change
@Override
public void restoreScratchRegistersBefore(Instruction s) {
for (Iterator<ScratchRegister> i = scratchInUse.iterator(); i.hasNext();) {
ScratchRegister scratch = i.next();
if (scratch.getCurrentContents() == null) continue;
if (VERBOSE_DEBUG) {
System.out.println("RESTORE: consider " + scratch);
}
boolean removed = false;
boolean unloaded = false;
if (definedIn(scratch.scratch, s) ||
(s.isCall() && s.operator() != CALL_SAVE_VOLATILE && scratch.scratch.isVolatile())) {
// s defines the scratch register, so save its contents before they
// are killed.
if (VERBOSE_DEBUG) {
System.out.println("RESTORE : unload because defined " + scratch);
}
unloadScratchRegisterBefore(s, scratch);
// update mapping information
if (VERBOSE_DEBUG) {
System.out.println("RSRB: End scratch interval " + scratch.scratch + " " + s);
}
scratchMap.endScratchInterval(scratch.scratch, s);
Register scratchContents = scratch.getCurrentContents();
if (scratchContents != null) {
if (VERBOSE_DEBUG) {
System.out.println("RSRB: End symbolic interval " + scratch.getCurrentContents() + " " + s);
}
scratchMap.endSymbolicInterval(scratch.getCurrentContents(), s);
}
i.remove();
removed = true;
unloaded = true;
}
if (usedIn(scratch.scratch, s) || !isLegal(scratch.getCurrentContents(), scratch.scratch, s)) {
// first spill the currents contents of the scratch register to
// memory
if (!unloaded) {
if (VERBOSE_DEBUG) {
System.out.println("RESTORE : unload because used " + scratch);
}
unloadScratchRegisterBefore(s, scratch);
// update mapping information
if (VERBOSE_DEBUG) {
System.out.println("RSRB2: End scratch interval " + scratch.scratch + " " + s);
}
scratchMap.endScratchInterval(scratch.scratch, s);
Register scratchContents = scratch.getCurrentContents();
if (scratchContents != null) {
if (VERBOSE_DEBUG) {
System.out.println("RSRB2: End symbolic interval " + scratch.getCurrentContents() + " " + s);
}
scratchMap.endSymbolicInterval(scratch.getCurrentContents(), s);
}